<template>
    <div id="userAgreement">
        <!-- <p class="txt">{{data}}</p> -->
        <div v-html='data' class="txt">{{data}}</div>
        <div class="nolist" v-show="lang=='zh'"  v-if="dataLength==0">暂无内容</div>
        <div class="nolist" v-show="lang=='en'"  v-if="dataLength==0">nothing in list</div>
    </div>
</template>
<script>
import {getGuide} from '@/api/public'
export default {
    name:'guideDetails',
    //声明组件
    components:{

    },
    data (){
        return{
            lang:'zh',  //中英文
            data:'...',  //协议内容
            dataLength:'',  //数据长度
            id:0,  //第几个操作指南内容
        }
    },
    //实例创建完成后被立即调用
    created (){
        //获取语言环境
        this.getLang();
        //获取类型
        if(this.$route.query.id){
            this.id = this.$route.query.id;
            this.getguide();
        }
        
    },
    //监听
    watch:{

    },
    //计算属性
    computed:{

    },
    //
    methods:{
        //获取语言环境
    	getLang(){
            if(this.$route.query.lang){
    			this.lang = this.$route.query.lang;
    		}
        },
        getguide(){
            
            getGuide(this.id,this.lang).then(res=>{
				if(res.code==200){
                    this.data = res.data.content;
                    if(this.data.length > 0){
                        console.log(this.data)
                        this.dataLength = res.data.length;
					}else{
						this.dataLength = res.data.length;
					}
                }else{
                    Toast(res.msg)
                }
            });
        },
    }
    
}
</script>

<style lang="stylus" scoped>
*{
    box-sizing :border-box;
}

#userAgreement{
    width :100%;
    height :100%;
    overflow-x :hidden;
    background-color :#fff;
    padding :.266667rem;
    .txt{
        width :100%;
        line-height :.48rem;
        font-size :.4rem;
        color :#666;
        word-wrap:break-word;
      
    }
  
}
.nolist{
    width :100%;
    height :auto;
    padding: .266667rem ;
    text-align :center;
    font-family: PingFangSC-Regular;
    font-size: 0.373333rem;
    color: #a2a2a2;
    letter-spacing: 0.008rem;
}
</style>
<style>
   img{
    max-width :100%;
    /* height :auto; */
    
} 
strong{
    font-weight: bold;
       color :#333;

}
</style>

